//
type Direction = 'up' | 'down' | 'left' | 'right';

function changeDir(direction: Direction): void {
  console.log(direction);
}

// 次函数只能穿 'up' | 'down' | 'left' | 'right'
changeDir('right');

window.addEventListener('resize', (e) => console.log(e));
